﻿@model Cafeteria.Models.Administracion.Sucursal.SucursalBean

@{
    ViewBag.Title = "Lista Personal";
}

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>


 @using (Html.BeginForm("añadirpersonal", "Sucursal", FormMethod.Post, new { @class = "form" }))
 {   
    
    <fieldset>
        <div class="widget">
            <div class="title">
                <h6>Sucursal</h6>
            </div>
            <div class="formRow"> @Html.LabelFor(model => model.id)
                <div class=" formRight">  @Html.DisplayFor(model => model.id)  </div>@Html.HiddenFor(model => model.id) 
                <div class="clear"></div>
            </div>
            <div class="formRow"> @Html.LabelFor(model => model.nombre)
                <div class=" formRight">  @Html.DisplayFor(model => model.nombre)  </div>@Html.HiddenFor(model => model.nombre) 
                <div class="clear"></div>
            </div>
            <div class="formRow"> @Html.LabelFor(model => model.telefono1) 
                <div class=" formRight">  @Html.DisplayFor(model => model.telefono1)-  @Html.DisplayFor(model => model.telefono2) </div>@Html.HiddenFor(model => model.telefono1) @Html.HiddenFor(model => model.telefono2)

                <div class="clear"></div>
            </div>
            
             @for (int i = 0; i < Model.listadepersonal.Count; i++)
             {
                    @Html.HiddenFor(model => model.listadepersonal[i].ID)  
                
             }
        </div>
    </fieldset>
    
       
      <div class="wrapper">
    <div class="widget">
      <div class="title">
      <h6>Lista de Personas</h6>
      </div>
      <div class="dataTables_wrapper">
            
            <table cellpadding = "0" cellspacing = "0" width = "100%" class = "display dTable">
    <thead>
        <tr>
            <th class="ui-state-default" rowspan="1" colspan="1" style="width:209px;" >
                <div class="DataTables_sort_wrapper">
                Seleccionar
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>

            <th class="ui-state-default" rowspan="1" colspan="1" style="width:209px;" >
                <div class="DataTables_sort_wrapper">
                ID
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
            <th class="ui-state-default" rowspan="1" colspan="1" style="width:209px;" >
                <div class="DataTables_sort_wrapper">
                Nombre
                <span class="DataTables_sort_icon css_right ui-icon ui-icon-triangle-1-s"></span>
                </div>
             </th>
        </tr>
    </thead>

    <tbody>

    @for (int i = 0; i < Model.listadepersonal.Count; i++)
    {
        if (!Model.listadepersonal[i].estaen)
        {
            <tr class="gradeA odd">
            <td> @Html.CheckBoxFor(model => model.listadepersonal[i].estadosucur, true)</td>
            <td class="sorting_1">@Html.DisplayFor(model => model.listadepersonal[i].ID)</td>
            <td class="sorting_1">@Html.DisplayFor(model => model.listadepersonal[i].nombres) @Html.DisplayFor(model => model.listadepersonal[i].apPat)
                                    @Html.DisplayFor(model => model.listadepersonal[i].apMat)
            </td>
            </tr>
        }
        else
        {
            @Html.HiddenFor(model => model.listadepersonal[i].estadosucur, true)
            @Html.HiddenFor(model => model.listadepersonal[i].ID)
            @Html.HiddenFor(model => model.listadepersonal[i].nombres)
            @Html.HiddenFor(model => model.listadepersonal[i].nombrePerfilUsuario)
        }

    }
    </tbody>
    </table>
    </div>
        
    </div>
</div>
     
    <p>
        @if (ViewBag.estado == 0)
        {
            <input type="submit" value="Guardar" class = "redB" />
        }    
        
        <a href="javascript:history.back()">Regresar</a>
    </p>
 }

